//封装对restFul接口的访问
const group_name='api';
const method_name='gathering';

import request from '@/utils/request'
export default {
    //查询列表
    getList(){
        return request(
            {
                url:`/${group_name}/${method_name}`,
                method:'get'
            }
        );
    },
    //分页查询
    getListByPage(page,size,searchMap){
        return request({
            url:`/${group_name}/${method_name}/search/${page}/${size}`,
            method:'post',
            data:searchMap
        });
    },
    //保存
    save(pojo){
        return request({
            url:`/${group_name}/${method_name}`,
            method:'post',
            data:pojo
        })
    },
    //根据ID查询活动信息
    findById(id){
        return request({
            url:`/${group_name}/${method_name}/${id}`,
            method:'get'
        })
    },
    //根据ID修改活动信息
    update(id,pojo){
        //优化
        if(id==null||id==''){
            return this.save(pojo);
        }
        return request({
            url:`/${group_name}/${method_name}/${id}`,
            method:'put',
            data:pojo
        })
    },
    //根据ID删除活动信息
    deleteById(id){
        return request({
            url:`/${group_name}/${method_name}/${id}`,
            method:'delete'
        })
    }
}

